<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CallCenterMgr 登录页</title>
<c:import url="/common/meta.html"/>
<link href="${ctx}/css/login.css" type="text/css" rel="stylesheet"/>
<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/jquery.validate.js" type="text/javascript"></script>
<script src="${ctx}/js/validate/messages_cn.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#j_username").focus();
 	$("#loginForm").validate();
});
function refreshCaptcha(){
	$('#captchaImg').html('<img src="${ctx}/security/jcaptcha.jpg?'+Math.round(Math.random()*100000)+'" title="看不清？点击换一张"/>');
}
</script>
</head>
<body class="small login">
<div id="wrapper">
	<div id="header"><h1>COOLBABY</h1></div>
	<div class="container">
		<div id="topcorners">
			<div class="cleft"></div>
			<div class="cright"></div>
		</div>
		<div id="content">
		<s:set name="errorCode" value="#parameters.error[0]"/>
		<s:if test="#errorCode == 1">
			<span style="color:red">用户名或密码错误,请重试.</span>
		</s:if>
		<s:elseif test="#errorCode == 2">
			<span style="color:red">验证码错误,请重试.</span>
		</s:elseif>
		<s:elseif test="#errorCode == 3">
			<span style="color:red">此帐号已从别处登录.</span>
		</s:elseif>
		<form id="loginForm" action="${ctx}/j_spring_security_check" method="post">
		<table class="login" style="margin-left: auto; margin-right: auto;">
			<tr>
				<td>
				<p class="mtop0 mbottom025"><strong><label for="j_username">用户名:</label></strong></p>
				<input id="j_username" tabindex="1" class="required" type="text" name="j_username" style="width:180px"/>
				</td>
			</tr>
			<tr>
				<td>
				<p class="mtop05 mbottom025"><strong><label for="j_password">密码:</label></strong></p>
				<input tabindex="2" class="required" type="password" name="j_password" id="j_password" style="width:180px"/>
				</td>
			</tr>
			<tr>
				<td>
				<p class="mtop05 mbottom025"><strong><label for="j_captcha">验证码:</label></strong></p>
				<input tabindex="3" class="required" type="text" name="j_captcha" id="j_captcha" style="width:180px"/>
				</td>
			</tr>
			<tr>
				<td>
				<span id="captchaImg" onclick="javascript:refreshCaptcha()" style="cursor:pointer;">
					<img src="${ctx}/security/jcaptcha.jpg" title="看不清？点击换一张" />
				</span>
				</td>
			</tr>
			<tr>
				<td>
				<p class="mtop025 mbottom0"><input type="checkbox" name="_spring_security_remember_me" id="rememberMe" 
				tabindex="4" /> <strong><label for="rememberMe">两周内记住我</label></strong></p>
				</td>
			</tr>
			<tr>
				<td style="padding-top: 10px;">
				<input class="loginbtn" type="submit" tabindex="4" value="" onmousedown="this.className='loginbtnfocus';return true;"/>
				</td>
			</tr>
		</table>
		</form>
		</div>
		<div id="bottomcorners">
			<div class="cleft"></div>
			<div class="cright"></div>
		</div>
	</div>
</div>

</body>
</html>